change log

Introduction

The Data

Main dataset

Data is stored in this repo’s data dir. The raw directory contains the raw data files recieved, which were copied to the clean dir, and modified as needed.

The bulk of the data was from file “Box Behnken analysis.xlsx”, recieved from RN via Skype on 2019-02-27, and this file was an updated version of the earlier “All Raw Data Mini Trial.xlsx” file. The data were in the “Block on rep” and “methane” tabs.

The main changes to “Box Behnken analysis” that were made:

  • label OLR was changed to OL to reflect the time-independant nature of the value
  • label HRT was changed to time, for the inverse reason
  • the methane aggretation was fixed to prevent values from being summed twice
  • addition of an “export” tab, for exporting to csv.

All these changes can be found in “./data/clean/Box Behnken analysis_nick_27.02.19.xlsx”, and exported as “./data/clean/trial_data.csv”.

Day 0 Values

After discussion about the experimental setup and the move to a time-based model rather than the Box Behnken analysis, we requested the Day 0 values for the 3 feedstocks, innoculum, and their mixtures. The file “Mini Trial FS FIB TS&VS.xlsx” was recieved 2019-04-30 from SN.

Data was aggregated and exported as “./data/clean/day0.csv” from the “day0” worksheet I added.

Processed data

The results of the two datasets are combined and written to the clean folder as cleaned_combined_minitrial_data.csv.

A note about experimental design and terms

Three things are mixed in these reractors: slurry, Food waste, and the iccoculum (from an AD reactor) Recipe may be used interchangably with Feedstock. There are 3 recipes, with different slurry:food waste ratios of 1:2, 1:3, and 3:1.

  • OL: organic load, expressed in g VS/L
  • sCOD: the soluble Chemical Oxygen Demand

Todo

Data explorations

First thing we did was read in the main data file and merge it with the day 0 data. Because the day zero are true for all temperatures, we duplicate the data for the 19 and 55 degree conditions. Then, we convert log-scale the the indicator bacteria counts, adding a dummy value of 1 to prevent errors of logging 0.

main_data <- read.csv("./data/clean/trial_data.csv")
day0 <- read.csv("./data/clean/day0.csv", skip=3, skipNul = T, stringsAsFactors = F)
day0 <- day0 %>% select(-fs_conc, -fs_vol, -inoc_conc, -inoc_vol) %>% spread(key = measurement, value = Value)
day0<- rbind(
  day0,
  day0 %>% transform(Temp=replace(Temp,Temp==37, 19)),
  day0 %>% transform(Temp=replace(Temp,Temp==37, 55))
) 
names(main_data)
##  [1] "Temp"        "OL"          "Time"        "Recipe"      "Ammonia"    
##  [6] "pH"          "sCOD"        "TS"          "VS"          "Coliforms"  
## [11] "Ecoli"       "Enterococci" "Methane"
names(day0)
##  [1] "Recipe"      "Temp"        "OL"          "Time"        "Ammonia"    
##  [6] "Coliforms"   "Ecoli"       "Enterococci" "Methane"     "pH"         
## [11] "sCOD"        "TS"          "VS"
sn_raw <- rbind(main_data, day0)

sn <- sn_raw %>%
  rowwise() %>% 
  transform(
    Recipe=as.factor(Recipe),
    Ecoli =  log10(Ecoli + 1),
    Coliforms = log10(Coliforms + 1),
    Enterococci = log10(Enterococci + 1))
summary(sn)
##       Temp          OL           Time         Recipe      Ammonia    
##  Min.   :19   Min.   :0.5   Min.   :0.000   FWS12:69   Min.   : 865  
##  1st Qu.:19   1st Qu.:0.5   1st Qu.:3.000   FWS13:69   1st Qu.:1452  
##  Median :37   Median :2.0   Median :6.000   FWS31:69   Median :1625  
##  Mean   :37   Mean   :2.0   Mean   :5.217              Mean   :1619  
##  3rd Qu.:55   3rd Qu.:3.5   3rd Qu.:6.000              3rd Qu.:1768  
##  Max.   :55   Max.   :3.5   Max.   :9.000              Max.   :2305  
##        pH             sCOD             TS              VS       
##  Min.   :6.840   Min.   : 6522   Min.   :4.840   Min.   :3.120  
##  1st Qu.:7.240   1st Qu.: 8262   1st Qu.:5.570   1st Qu.:3.410  
##  Median :7.440   Median :10111   Median :5.740   Median :3.560  
##  Mean   :7.436   Mean   :10502   Mean   :5.874   Mean   :3.705  
##  3rd Qu.:7.510   3rd Qu.:12261   3rd Qu.:6.035   3rd Qu.:3.860  
##  Max.   :8.060   Max.   :22965   Max.   :8.095   Max.   :5.371  
##    Coliforms         Ecoli        Enterococci       Methane      
##  Min.   :0.000   Min.   :0.000   Min.   :0.000   Min.   :  0.00  
##  1st Qu.:2.249   1st Qu.:2.154   1st Qu.:4.511   1st Qu.:  5.75  
##  Median :4.772   Median :4.502   Median :5.178   Median : 19.50  
##  Mean   :3.857   Mean   :3.675   Mean   :4.757   Mean   : 40.89  
##  3rd Qu.:5.380   3rd Qu.:5.255   3rd Qu.:5.871   3rd Qu.: 75.55  
##  Max.   :8.020   Max.   :8.020   Max.   :7.322   Max.   :188.30

It may prove useful to note the components of the three recipes. The organic loading rates were calcualted based on the volitile solid quantity. the recepies are ratios of 2 of three ingrrerdiates (not including the innoculum, which is added as discussed above): dairy cattle slurry(DCS), Fats Oils and Grease (FOG), and restauraant food waste (RFW).

We add those proportion to the data. Then, we save the cleaned, prepated data.

recipes <- data.frame(
  Recipe= c("FWS12","FWS13","FWS31"),
  RFW= as.factor(round(c(0, 3/4, 1/4), 2)),
  DCS=as.factor(round(c(1/3, 1/4, 3/4),2)),
  FOG=as.factor(round(c(2/3, 0, 0), 2))
)
sn <- merge(sn, recipes, by="Recipe")
write.csv(sn, "data/clean/cleaned_combined_minitrial_data.csv")

Note that the conditions were set to have 3 different loading rates, which we will treat as categorical because while they are numerical values of .5, 2, or 3.5, these are not observed values. There for we set them to be factors (which allows for categories to be ranked by a inheirent value).

Next, we can do some explortatory analysis:

sn$OL <- as.factor(sn$OL)
ggscatmat(sn,  color="Recipe", alpha = .3) + theme(legend.position = "bottom") 
## Warning in ggscatmat(sn, color = "Recipe", alpha = 0.3): Factor variables
## are omitted in plot

#ggpairs(sn, aes(color=Recipe, alpha=.5))

Initial observations:

Lets replot without some of the highly correlated ones that

ggscatmat(sn %>% select(-TS, -Coliforms),  color="Recipe", alpha = .3) + theme(legend.position = "bottom")
## Warning in ggscatmat(sn %>% select(-TS, -Coliforms), color = "Recipe",
## alpha = 0.3): Factor variables are omitted in plot

Lets look at the indicators

Enterococci

It looks like there is a big effect of temperature: Enterococci die-off only occurs at 55, and there may be a small degree of die-off at 37 for FWS12. Keeping inmind that 55 degree operation is rarely cost effective, lets look without the 55 degree condition.

It appears that nothing dirastic is happening to the Enterococci regardless of recipe for 19 and 37 degrees.

We can further split this out by the proportion of the different componenets in the feedstock

ggplot(sn, aes(x=Time, y=Enterococci, color=as.factor(DCS))) + 
  geom_point() + 
  labs(caption=fn("Effect of OL vs DCS"), 
       subtitle="No effect due to proportion of DCS", color="") +
  facet_wrap(~OL+Temp)  + 
  geom_smooth(method = lm)

ggplot(sn, aes(x=Temp, y=Enterococci, color=as.factor(RFW))) + 
  labs(caption=fn("Effect of Temp"), color="RFW") +
  geom_point() + geom_smooth(method = lm)

ggplot(sn, aes(x=Time, y=Enterococci, color=as.factor(Temp))) +
  geom_point() + 
  labs(subtitle="At 19 and 37, presence of RFW increases Enterococci survival",
       caption=fn("Effect of RFW"), color="") +
  facet_wrap(~RFW)  + geom_smooth(method = lm)

Those rates seem to indicate 2 things:

  • that the higher proportion of restaurant food waste, the better enterococci survive
  • regardless of the proportion of RFW, increased temperature inhibits Enterococci

E. coli

ggplot(sn, aes(x=Time, y=Ecoli, color=as.factor(Temp))) +
  geom_point()  + geom_smooth(method = lm) + 
  labs(caption=fn("Effect of Temperature"), color="")

ggplot(sn, aes(x=Time, y=Ecoli, color=as.factor(Temp))) +
  geom_point() + 
  facet_wrap(~OL+Recipe)  +
  geom_smooth(method = lm) + 
  labs(caption=fn("Effect of OL and Recipe"), color="")

E coli counts seem to depend largely on Temp rather than OL or Recipe.

This may indicate that while die-off occurs at cold temperature, higher temperatue increases the die-off rate.

While dieoff occurs at 37 and 55, it also appears to occur at 19 with FWS13.

In All cases at low temperatures, lower OL yields better dieoff.

Coliforms

Coliforms should be have the same as E. coli (as we saw their values being highly correlated), but lets observe:

ggplot(sn, aes(x=Time, y=Coliforms, color=as.factor(Temp))) +
  geom_point()  + geom_smooth(method = lm) + 
  labs(caption=fn("Effect of Temperature"), color="")

Coliform counts too seem to depend largely on Temp rather than OL or Recipe.

Except for FWS31, lower OL inproves die-off.

Ammonia

ggplot(sn, aes(x=Time, y=Ammonia, color=as.factor(Temp))) +
  geom_point()  + geom_smooth(method = lm) + 
  facet_wrap(~Recipe )  +
  labs(caption=fn("Effect of Temperature and Recipe"), color="")

Across all recipes and temperatures, Ammonia decreases as a function of time.

Methane

Methane is the only thing leaving the bioreactors (as biogas), and therefore was measured daily until detructive sampling at 3, 6, or 9 days. We have aggregated the data in the original excel sheet.

ggplot(sn, aes(x=Time, y=Methane, color=as.factor(Recipe))) +
  geom_point()  + geom_smooth(method = lm) + 
  facet_wrap(~Temp )  +
  labs(caption=fn("Effect of Temperature and Recipe"), color="")

ggplot(sn, aes(x=Time, y=Methane, color=as.factor(Temp))) +
  geom_point()  + geom_smooth(method = lm) + 
  facet_wrap(~Recipe )  +
  labs(caption=fn("Effect of Recipe and Temperature"), color="")

ggplot(sn, aes(x=Time, y=Methane, color=as.factor(Temp))) +
  geom_point()  + geom_smooth(method = lm) + 
  facet_wrap(~Recipe + OL )  +
  labs(caption=fn("Effect of Temperature and OL"), color="")

It looks like the rate of poduction is highest at 37, and that at the optimal feed stocks with a high OL yield high prroduction, expecially at 37.

pH

ggplot(sn, aes(x=Time, y=pH, color=as.factor(Recipe))) +
  geom_point()  + geom_smooth(method = lm) + 
  facet_wrap(~Temp )  +
  labs(caption=fn("Effect of Temperature and Recipe"), color="")

The range of pH is rerlatively tight, but it appears to drop with time at the temperature extremes, staying the most stable at 37

Modelling

stan_data = list(
    nbugs=3,
    nrows=nrow(sn),
    Temp=(sn$Temp -19)/18 + 1,
    Ammonia=sn$Ammonia,
    pH=sn$pH,
    Ecoli=sn$Ecoli,
    Coliforms=sn$Coliforms,
    Time=sn$Time,
    OL=ifelse(sn$OL==.5, 1, ifelse(sn$OL==3.5, 3, sn$OL)),
    Enterococci=sn$Enterococci,
    sCOD=sn$sCOD,
    VS=sn$VS,
    TS=sn$TS,
    Recipe=as.numeric(sn$Recipe),
    Methane=sn$Methane
  )
fit <- stan(
  file = "./models/model_min.stan",
  verbose = T,
  chains=4,
  data = stan_data
)
## 
## TRANSLATING MODEL 'model_min' FROM Stan CODE TO C++ CODE NOW.
## successful in parsing the Stan model 'model_min'.
## recompiling to avoid crashing R session
## OS: x86_64, darwin15.6.0; rstan: 2.18.2; Rcpp: 1.0.1; inline: 0.3.15 
##  >> setting environment variables: 
## PKG_LIBS =  -L'/Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/lib/' -lStanHeaders
## PKG_CPPFLAGS =   -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/"  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/"  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/unsupported"  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/"  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/"  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS
##  >> Program source :
## 
##    1 : 
##    2 : // includes from the plugin
##    3 : // [[Rcpp::plugins(cpp14)]]
##    4 : 
##    5 : // user includes
##    6 : #define STAN__SERVICES__COMMAND_HPP// Code generated by Stan version 2.18.0
##    7 : 
##    8 : #include <stan/model/model_header.hpp>
##    9 : 
##   10 : namespace modeld8e35e346352_model_min_namespace {
##   11 : 
##   12 : using std::istream;
##   13 : using std::string;
##   14 : using std::stringstream;
##   15 : using std::vector;
##   16 : using stan::io::dump;
##   17 : using stan::math::lgamma;
##   18 : using stan::model::prob_grad;
##   19 : using namespace stan::math;
##   20 : 
##   21 : static int current_statement_begin__;
##   22 : 
##   23 : stan::io::program_reader prog_reader__() {
##   24 :     stan::io::program_reader reader;
##   25 :     reader.add_event(0, 0, "start", "modeld8e35e346352_model_min");
##   26 :     reader.add_event(59, 57, "end", "modeld8e35e346352_model_min");
##   27 :     return reader;
##   28 : }
##   29 : 
##   30 : class modeld8e35e346352_model_min : public prob_grad {
##   31 : private:
##   32 :     int nrows;
##   33 :     int nbugs;
##   34 :     vector<double> Ecoli;
##   35 :     vector<double> Enterococci;
##   36 :     vector<int> Recipe;
##   37 :     vector<int> Time;
##   38 :     vector<double> sCOD;
##   39 :     vector<int> OL;
##   40 :     vector<double> VS;
##   41 :     vector<double> Ammonia;
##   42 :     vector<int> Temp;
##   43 :     vector<double> Methane;
##   44 : public:
##   45 :     modeld8e35e346352_model_min(stan::io::var_context& context__,
##   46 :         std::ostream* pstream__ = 0)
##   47 :         : prob_grad(0) {
##   48 :         ctor_body(context__, 0, pstream__);
##   49 :     }
##   50 : 
##   51 :     modeld8e35e346352_model_min(stan::io::var_context& context__,
##   52 :         unsigned int random_seed__,
##   53 :         std::ostream* pstream__ = 0)
##   54 :         : prob_grad(0) {
##   55 :         ctor_body(context__, random_seed__, pstream__);
##   56 :     }
##   57 : 
##   58 :     void ctor_body(stan::io::var_context& context__,
##   59 :                    unsigned int random_seed__,
##   60 :                    std::ostream* pstream__) {
##   61 :         typedef double local_scalar_t__;
##   62 : 
##   63 :         boost::ecuyer1988 base_rng__ =
##   64 :           stan::services::util::create_rng(random_seed__, 0);
##   65 :         (void) base_rng__;  // suppress unused var warning
##   66 : 
##   67 :         current_statement_begin__ = -1;
##   68 : 
##   69 :         static const char* function__ = "modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min";
##   70 :         (void) function__;  // dummy to suppress unused var warning
##   71 :         size_t pos__;
##   72 :         (void) pos__;  // dummy to suppress unused var warning
##   73 :         std::vector<int> vals_i__;
##   74 :         std::vector<double> vals_r__;
##   75 :         local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
##   76 :         (void) DUMMY_VAR__;  // suppress unused var warning
##   77 : 
##   78 :         // initialize member variables
##   79 :         try {
##   80 :             current_statement_begin__ = 2;
##   81 :             context__.validate_dims("data initialization", "nrows", "int", context__.to_vec());
##   82 :             nrows = int(0);
##   83 :             vals_i__ = context__.vals_i("nrows");
##   84 :             pos__ = 0;
##   85 :             nrows = vals_i__[pos__++];
##   86 :             current_statement_begin__ = 3;
##   87 :             context__.validate_dims("data initialization", "nbugs", "int", context__.to_vec());
##   88 :             nbugs = int(0);
##   89 :             vals_i__ = context__.vals_i("nbugs");
##   90 :             pos__ = 0;
##   91 :             nbugs = vals_i__[pos__++];
##   92 :             current_statement_begin__ = 4;
##   93 :             validate_non_negative_index("Ecoli", "nrows", nrows);
##   94 :             context__.validate_dims("data initialization", "Ecoli", "double", context__.to_vec(nrows));
##   95 :             validate_non_negative_index("Ecoli", "nrows", nrows);
##   96 :             Ecoli = std::vector<double>(nrows,double(0));
##   97 :             vals_r__ = context__.vals_r("Ecoli");
##   98 :             pos__ = 0;
##   99 :             size_t Ecoli_limit_0__ = nrows;
##  100 :             for (size_t i_0__ = 0; i_0__ < Ecoli_limit_0__; ++i_0__) {
##  101 :                 Ecoli[i_0__] = vals_r__[pos__++];
##  102 :             }
##  103 :             current_statement_begin__ = 5;
##  104 :             validate_non_negative_index("Enterococci", "nrows", nrows);
##  105 :             context__.validate_dims("data initialization", "Enterococci", "double", context__.to_vec(nrows));
##  106 :             validate_non_negative_index("Enterococci", "nrows", nrows);
##  107 :             Enterococci = std::vector<double>(nrows,double(0));
##  108 :             vals_r__ = context__.vals_r("Enterococci");
##  109 :             pos__ = 0;
##  110 :             size_t Enterococci_limit_0__ = nrows;
##  111 :             for (size_t i_0__ = 0; i_0__ < Enterococci_limit_0__; ++i_0__) {
##  112 :                 Enterococci[i_0__] = vals_r__[pos__++];
##  113 :             }
##  114 :             current_statement_begin__ = 6;
##  115 :             validate_non_negative_index("Recipe", "nrows", nrows);
##  116 :             context__.validate_dims("data initialization", "Recipe", "int", context__.to_vec(nrows));
##  117 :             validate_non_negative_index("Recipe", "nrows", nrows);
##  118 :             Recipe = std::vector<int>(nrows,int(0));
##  119 :             vals_i__ = context__.vals_i("Recipe");
##  120 :             pos__ = 0;
##  121 :             size_t Recipe_limit_0__ = nrows;
##  122 :             for (size_t i_0__ = 0; i_0__ < Recipe_limit_0__; ++i_0__) {
##  123 :                 Recipe[i_0__] = vals_i__[pos__++];
##  124 :             }
##  125 :             current_statement_begin__ = 7;
##  126 :             validate_non_negative_index("Time", "nrows", nrows);
##  127 :             context__.validate_dims("data initialization", "Time", "int", context__.to_vec(nrows));
##  128 :             validate_non_negative_index("Time", "nrows", nrows);
##  129 :             Time = std::vector<int>(nrows,int(0));
##  130 :             vals_i__ = context__.vals_i("Time");
##  131 :             pos__ = 0;
##  132 :             size_t Time_limit_0__ = nrows;
##  133 :             for (size_t i_0__ = 0; i_0__ < Time_limit_0__; ++i_0__) {
##  134 :                 Time[i_0__] = vals_i__[pos__++];
##  135 :             }
##  136 :             current_statement_begin__ = 8;
##  137 :             validate_non_negative_index("sCOD", "nrows", nrows);
##  138 :             context__.validate_dims("data initialization", "sCOD", "double", context__.to_vec(nrows));
##  139 :             validate_non_negative_index("sCOD", "nrows", nrows);
##  140 :             sCOD = std::vector<double>(nrows,double(0));
##  141 :             vals_r__ = context__.vals_r("sCOD");
##  142 :             pos__ = 0;
##  143 :             size_t sCOD_limit_0__ = nrows;
##  144 :             for (size_t i_0__ = 0; i_0__ < sCOD_limit_0__; ++i_0__) {
##  145 :                 sCOD[i_0__] = vals_r__[pos__++];
##  146 :             }
##  147 :             current_statement_begin__ = 9;
##  148 :             validate_non_negative_index("OL", "nrows", nrows);
##  149 :             context__.validate_dims("data initialization", "OL", "int", context__.to_vec(nrows));
##  150 :             validate_non_negative_index("OL", "nrows", nrows);
##  151 :             OL = std::vector<int>(nrows,int(0));
##  152 :             vals_i__ = context__.vals_i("OL");
##  153 :             pos__ = 0;
##  154 :             size_t OL_limit_0__ = nrows;
##  155 :             for (size_t i_0__ = 0; i_0__ < OL_limit_0__; ++i_0__) {
##  156 :                 OL[i_0__] = vals_i__[pos__++];
##  157 :             }
##  158 :             current_statement_begin__ = 10;
##  159 :             validate_non_negative_index("VS", "nrows", nrows);
##  160 :             context__.validate_dims("data initialization", "VS", "double", context__.to_vec(nrows));
##  161 :             validate_non_negative_index("VS", "nrows", nrows);
##  162 :             VS = std::vector<double>(nrows,double(0));
##  163 :             vals_r__ = context__.vals_r("VS");
##  164 :             pos__ = 0;
##  165 :             size_t VS_limit_0__ = nrows;
##  166 :             for (size_t i_0__ = 0; i_0__ < VS_limit_0__; ++i_0__) {
##  167 :                 VS[i_0__] = vals_r__[pos__++];
##  168 :             }
##  169 :             current_statement_begin__ = 11;
##  170 :             validate_non_negative_index("Ammonia", "nrows", nrows);
##  171 :             context__.validate_dims("data initialization", "Ammonia", "double", context__.to_vec(nrows));
##  172 :             validate_non_negative_index("Ammonia", "nrows", nrows);
##  173 :             Ammonia = std::vector<double>(nrows,double(0));
##  174 :             vals_r__ = context__.vals_r("Ammonia");
##  175 :             pos__ = 0;
##  176 :             size_t Ammonia_limit_0__ = nrows;
##  177 :             for (size_t i_0__ = 0; i_0__ < Ammonia_limit_0__; ++i_0__) {
##  178 :                 Ammonia[i_0__] = vals_r__[pos__++];
##  179 :             }
##  180 :             current_statement_begin__ = 12;
##  181 :             validate_non_negative_index("Temp", "nrows", nrows);
##  182 :             context__.validate_dims("data initialization", "Temp", "int", context__.to_vec(nrows));
##  183 :             validate_non_negative_index("Temp", "nrows", nrows);
##  184 :             Temp = std::vector<int>(nrows,int(0));
##  185 :             vals_i__ = context__.vals_i("Temp");
##  186 :             pos__ = 0;
##  187 :             size_t Temp_limit_0__ = nrows;
##  188 :             for (size_t i_0__ = 0; i_0__ < Temp_limit_0__; ++i_0__) {
##  189 :                 Temp[i_0__] = vals_i__[pos__++];
##  190 :             }
##  191 :             current_statement_begin__ = 13;
##  192 :             validate_non_negative_index("Methane", "nrows", nrows);
##  193 :             context__.validate_dims("data initialization", "Methane", "double", context__.to_vec(nrows));
##  194 :             validate_non_negative_index("Methane", "nrows", nrows);
##  195 :             Methane = std::vector<double>(nrows,double(0));
##  196 :             vals_r__ = context__.vals_r("Methane");
##  197 :             pos__ = 0;
##  198 :             size_t Methane_limit_0__ = nrows;
##  199 :             for (size_t i_0__ = 0; i_0__ < Methane_limit_0__; ++i_0__) {
##  200 :                 Methane[i_0__] = vals_r__[pos__++];
##  201 :             }
##  202 : 
##  203 :             // validate, data variables
##  204 :             current_statement_begin__ = 2;
##  205 :             check_greater_or_equal(function__,"nrows",nrows,0);
##  206 :             current_statement_begin__ = 3;
##  207 :             check_greater_or_equal(function__,"nbugs",nbugs,0);
##  208 :             current_statement_begin__ = 4;
##  209 :             current_statement_begin__ = 5;
##  210 :             current_statement_begin__ = 6;
##  211 :             current_statement_begin__ = 7;
##  212 :             current_statement_begin__ = 8;
##  213 :             current_statement_begin__ = 9;
##  214 :             current_statement_begin__ = 10;
##  215 :             current_statement_begin__ = 11;
##  216 :             current_statement_begin__ = 12;
##  217 :             current_statement_begin__ = 13;
##  218 :             // initialize data variables
##  219 : 
##  220 : 
##  221 :             // validate transformed data
##  222 : 
##  223 :             // validate, set parameter ranges
##  224 :             num_params_r__ = 0U;
##  225 :             param_ranges_i__.clear();
##  226 :             current_statement_begin__ = 16;
##  227 :             validate_non_negative_index("recipe_effect_m", "3", 3);
##  228 :             num_params_r__ += 3;
##  229 :             current_statement_begin__ = 17;
##  230 :             validate_non_negative_index("temp_effect_m", "3", 3);
##  231 :             num_params_r__ += 3;
##  232 :             current_statement_begin__ = 18;
##  233 :             validate_non_negative_index("ol_effect_m", "3", 3);
##  234 :             num_params_r__ += 3;
##  235 :             current_statement_begin__ = 19;
##  236 :             validate_non_negative_index("recipe_effect_b", "3", 3);
##  237 :             num_params_r__ += 3;
##  238 :             current_statement_begin__ = 20;
##  239 :             validate_non_negative_index("temp_effect_b", "3", 3);
##  240 :             num_params_r__ += 3;
##  241 :             current_statement_begin__ = 21;
##  242 :             validate_non_negative_index("ol_effect_b", "3", 3);
##  243 :             num_params_r__ += 3;
##  244 :             current_statement_begin__ = 22;
##  245 :             ++num_params_r__;
##  246 :             current_statement_begin__ = 23;
##  247 :             ++num_params_r__;
##  248 :         } catch (const std::exception& e) {
##  249 :             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
##  250 :             // Next line prevents compiler griping about no return
##  251 :             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
##  252 :         }
##  253 :     }
##  254 : 
##  255 :     ~modeld8e35e346352_model_min() { }
##  256 : 
##  257 : 
##  258 :     void transform_inits(const stan::io::var_context& context__,
##  259 :                          std::vector<int>& params_i__,
##  260 :                          std::vector<double>& params_r__,
##  261 :                          std::ostream* pstream__) const {
##  262 :         stan::io::writer<double> writer__(params_r__,params_i__);
##  263 :         size_t pos__;
##  264 :         (void) pos__; // dummy call to supress warning
##  265 :         std::vector<double> vals_r__;
##  266 :         std::vector<int> vals_i__;
##  267 : 
##  268 :         if (!(context__.contains_r("recipe_effect_m")))
##  269 :             throw std::runtime_error("variable recipe_effect_m missing");
##  270 :         vals_r__ = context__.vals_r("recipe_effect_m");
##  271 :         pos__ = 0U;
##  272 :         validate_non_negative_index("recipe_effect_m", "3", 3);
##  273 :         context__.validate_dims("initialization", "recipe_effect_m", "double", context__.to_vec(3));
##  274 :         std::vector<double> recipe_effect_m(3,double(0));
##  275 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  276 :             recipe_effect_m[i0__] = vals_r__[pos__++];
##  277 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  278 :             try {
##  279 :             writer__.scalar_unconstrain(recipe_effect_m[i0__]);
##  280 :         } catch (const std::exception& e) { 
##  281 :             throw std::runtime_error(std::string("Error transforming variable recipe_effect_m: ") + e.what());
##  282 :         }
##  283 : 
##  284 :         if (!(context__.contains_r("temp_effect_m")))
##  285 :             throw std::runtime_error("variable temp_effect_m missing");
##  286 :         vals_r__ = context__.vals_r("temp_effect_m");
##  287 :         pos__ = 0U;
##  288 :         validate_non_negative_index("temp_effect_m", "3", 3);
##  289 :         context__.validate_dims("initialization", "temp_effect_m", "double", context__.to_vec(3));
##  290 :         std::vector<double> temp_effect_m(3,double(0));
##  291 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  292 :             temp_effect_m[i0__] = vals_r__[pos__++];
##  293 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  294 :             try {
##  295 :             writer__.scalar_unconstrain(temp_effect_m[i0__]);
##  296 :         } catch (const std::exception& e) { 
##  297 :             throw std::runtime_error(std::string("Error transforming variable temp_effect_m: ") + e.what());
##  298 :         }
##  299 : 
##  300 :         if (!(context__.contains_r("ol_effect_m")))
##  301 :             throw std::runtime_error("variable ol_effect_m missing");
##  302 :         vals_r__ = context__.vals_r("ol_effect_m");
##  303 :         pos__ = 0U;
##  304 :         validate_non_negative_index("ol_effect_m", "3", 3);
##  305 :         context__.validate_dims("initialization", "ol_effect_m", "double", context__.to_vec(3));
##  306 :         std::vector<double> ol_effect_m(3,double(0));
##  307 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  308 :             ol_effect_m[i0__] = vals_r__[pos__++];
##  309 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  310 :             try {
##  311 :             writer__.scalar_unconstrain(ol_effect_m[i0__]);
##  312 :         } catch (const std::exception& e) { 
##  313 :             throw std::runtime_error(std::string("Error transforming variable ol_effect_m: ") + e.what());
##  314 :         }
##  315 : 
##  316 :         if (!(context__.contains_r("recipe_effect_b")))
##  317 :             throw std::runtime_error("variable recipe_effect_b missing");
##  318 :         vals_r__ = context__.vals_r("recipe_effect_b");
##  319 :         pos__ = 0U;
##  320 :         validate_non_negative_index("recipe_effect_b", "3", 3);
##  321 :         context__.validate_dims("initialization", "recipe_effect_b", "double", context__.to_vec(3));
##  322 :         std::vector<double> recipe_effect_b(3,double(0));
##  323 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  324 :             recipe_effect_b[i0__] = vals_r__[pos__++];
##  325 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  326 :             try {
##  327 :             writer__.scalar_unconstrain(recipe_effect_b[i0__]);
##  328 :         } catch (const std::exception& e) { 
##  329 :             throw std::runtime_error(std::string("Error transforming variable recipe_effect_b: ") + e.what());
##  330 :         }
##  331 : 
##  332 :         if (!(context__.contains_r("temp_effect_b")))
##  333 :             throw std::runtime_error("variable temp_effect_b missing");
##  334 :         vals_r__ = context__.vals_r("temp_effect_b");
##  335 :         pos__ = 0U;
##  336 :         validate_non_negative_index("temp_effect_b", "3", 3);
##  337 :         context__.validate_dims("initialization", "temp_effect_b", "double", context__.to_vec(3));
##  338 :         std::vector<double> temp_effect_b(3,double(0));
##  339 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  340 :             temp_effect_b[i0__] = vals_r__[pos__++];
##  341 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  342 :             try {
##  343 :             writer__.scalar_unconstrain(temp_effect_b[i0__]);
##  344 :         } catch (const std::exception& e) { 
##  345 :             throw std::runtime_error(std::string("Error transforming variable temp_effect_b: ") + e.what());
##  346 :         }
##  347 : 
##  348 :         if (!(context__.contains_r("ol_effect_b")))
##  349 :             throw std::runtime_error("variable ol_effect_b missing");
##  350 :         vals_r__ = context__.vals_r("ol_effect_b");
##  351 :         pos__ = 0U;
##  352 :         validate_non_negative_index("ol_effect_b", "3", 3);
##  353 :         context__.validate_dims("initialization", "ol_effect_b", "double", context__.to_vec(3));
##  354 :         std::vector<double> ol_effect_b(3,double(0));
##  355 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  356 :             ol_effect_b[i0__] = vals_r__[pos__++];
##  357 :         for (int i0__ = 0U; i0__ < 3; ++i0__)
##  358 :             try {
##  359 :             writer__.scalar_unconstrain(ol_effect_b[i0__]);
##  360 :         } catch (const std::exception& e) { 
##  361 :             throw std::runtime_error(std::string("Error transforming variable ol_effect_b: ") + e.what());
##  362 :         }
##  363 : 
##  364 :         if (!(context__.contains_r("sigma")))
##  365 :             throw std::runtime_error("variable sigma missing");
##  366 :         vals_r__ = context__.vals_r("sigma");
##  367 :         pos__ = 0U;
##  368 :         context__.validate_dims("initialization", "sigma", "double", context__.to_vec());
##  369 :         double sigma(0);
##  370 :         sigma = vals_r__[pos__++];
##  371 :         try {
##  372 :             writer__.scalar_lb_unconstrain(0,sigma);
##  373 :         } catch (const std::exception& e) { 
##  374 :             throw std::runtime_error(std::string("Error transforming variable sigma: ") + e.what());
##  375 :         }
##  376 : 
##  377 :         if (!(context__.contains_r("sigma_b")))
##  378 :             throw std::runtime_error("variable sigma_b missing");
##  379 :         vals_r__ = context__.vals_r("sigma_b");
##  380 :         pos__ = 0U;
##  381 :         context__.validate_dims("initialization", "sigma_b", "double", context__.to_vec());
##  382 :         double sigma_b(0);
##  383 :         sigma_b = vals_r__[pos__++];
##  384 :         try {
##  385 :             writer__.scalar_lb_unconstrain(0,sigma_b);
##  386 :         } catch (const std::exception& e) { 
##  387 :             throw std::runtime_error(std::string("Error transforming variable sigma_b: ") + e.what());
##  388 :         }
##  389 : 
##  390 :         params_r__ = writer__.data_r();
##  391 :         params_i__ = writer__.data_i();
##  392 :     }
##  393 : 
##  394 :     void transform_inits(const stan::io::var_context& context,
##  395 :                          Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
##  396 :                          std::ostream* pstream__) const {
##  397 :       std::vector<double> params_r_vec;
##  398 :       std::vector<int> params_i_vec;
##  399 :       transform_inits(context, params_i_vec, params_r_vec, pstream__);
##  400 :       params_r.resize(params_r_vec.size());
##  401 :       for (int i = 0; i < params_r.size(); ++i)
##  402 :         params_r(i) = params_r_vec[i];
##  403 :     }
##  404 : 
##  405 : 
##  406 :     template <bool propto__, bool jacobian__, typename T__>
##  407 :     T__ log_prob(vector<T__>& params_r__,
##  408 :                  vector<int>& params_i__,
##  409 :                  std::ostream* pstream__ = 0) const {
##  410 : 
##  411 :         typedef T__ local_scalar_t__;
##  412 : 
##  413 :         local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
##  414 :         (void) DUMMY_VAR__;  // suppress unused var warning
##  415 : 
##  416 :         T__ lp__(0.0);
##  417 :         stan::math::accumulator<T__> lp_accum__;
##  418 : 
##  419 :         try {
##  420 :             // model parameters
##  421 :             stan::io::reader<local_scalar_t__> in__(params_r__,params_i__);
##  422 : 
##  423 :             vector<local_scalar_t__> recipe_effect_m;
##  424 :             size_t dim_recipe_effect_m_0__ = 3;
##  425 :             recipe_effect_m.reserve(dim_recipe_effect_m_0__);
##  426 :             for (size_t k_0__ = 0; k_0__ < dim_recipe_effect_m_0__; ++k_0__) {
##  427 :                 if (jacobian__)
##  428 :                     recipe_effect_m.push_back(in__.scalar_constrain(lp__));
##  429 :                 else
##  430 :                     recipe_effect_m.push_back(in__.scalar_constrain());
##  431 :             }
##  432 : 
##  433 :             vector<local_scalar_t__> temp_effect_m;
##  434 :             size_t dim_temp_effect_m_0__ = 3;
##  435 :             temp_effect_m.reserve(dim_temp_effect_m_0__);
##  436 :             for (size_t k_0__ = 0; k_0__ < dim_temp_effect_m_0__; ++k_0__) {
##  437 :                 if (jacobian__)
##  438 :                     temp_effect_m.push_back(in__.scalar_constrain(lp__));
##  439 :                 else
##  440 :                     temp_effect_m.push_back(in__.scalar_constrain());
##  441 :             }
##  442 : 
##  443 :             vector<local_scalar_t__> ol_effect_m;
##  444 :             size_t dim_ol_effect_m_0__ = 3;
##  445 :             ol_effect_m.reserve(dim_ol_effect_m_0__);
##  446 :             for (size_t k_0__ = 0; k_0__ < dim_ol_effect_m_0__; ++k_0__) {
##  447 :                 if (jacobian__)
##  448 :                     ol_effect_m.push_back(in__.scalar_constrain(lp__));
##  449 :                 else
##  450 :                     ol_effect_m.push_back(in__.scalar_constrain());
##  451 :             }
##  452 : 
##  453 :             vector<local_scalar_t__> recipe_effect_b;
##  454 :             size_t dim_recipe_effect_b_0__ = 3;
##  455 :             recipe_effect_b.reserve(dim_recipe_effect_b_0__);
##  456 :             for (size_t k_0__ = 0; k_0__ < dim_recipe_effect_b_0__; ++k_0__) {
##  457 :                 if (jacobian__)
##  458 :                     recipe_effect_b.push_back(in__.scalar_constrain(lp__));
##  459 :                 else
##  460 :                     recipe_effect_b.push_back(in__.scalar_constrain());
##  461 :             }
##  462 : 
##  463 :             vector<local_scalar_t__> temp_effect_b;
##  464 :             size_t dim_temp_effect_b_0__ = 3;
##  465 :             temp_effect_b.reserve(dim_temp_effect_b_0__);
##  466 :             for (size_t k_0__ = 0; k_0__ < dim_temp_effect_b_0__; ++k_0__) {
##  467 :                 if (jacobian__)
##  468 :                     temp_effect_b.push_back(in__.scalar_constrain(lp__));
##  469 :                 else
##  470 :                     temp_effect_b.push_back(in__.scalar_constrain());
##  471 :             }
##  472 : 
##  473 :             vector<local_scalar_t__> ol_effect_b;
##  474 :             size_t dim_ol_effect_b_0__ = 3;
##  475 :             ol_effect_b.reserve(dim_ol_effect_b_0__);
##  476 :             for (size_t k_0__ = 0; k_0__ < dim_ol_effect_b_0__; ++k_0__) {
##  477 :                 if (jacobian__)
##  478 :                     ol_effect_b.push_back(in__.scalar_constrain(lp__));
##  479 :                 else
##  480 :                     ol_effect_b.push_back(in__.scalar_constrain());
##  481 :             }
##  482 : 
##  483 :             local_scalar_t__ sigma;
##  484 :             (void) sigma;  // dummy to suppress unused var warning
##  485 :             if (jacobian__)
##  486 :                 sigma = in__.scalar_lb_constrain(0,lp__);
##  487 :             else
##  488 :                 sigma = in__.scalar_lb_constrain(0);
##  489 : 
##  490 :             local_scalar_t__ sigma_b;
##  491 :             (void) sigma_b;  // dummy to suppress unused var warning
##  492 :             if (jacobian__)
##  493 :                 sigma_b = in__.scalar_lb_constrain(0,lp__);
##  494 :             else
##  495 :                 sigma_b = in__.scalar_lb_constrain(0);
##  496 : 
##  497 : 
##  498 :             // transformed parameters
##  499 :             current_statement_begin__ = 26;
##  500 :             validate_non_negative_index("coli_hat", "nrows", nrows);
##  501 :             Eigen::Matrix<local_scalar_t__,Eigen::Dynamic,1>  coli_hat(static_cast<Eigen::VectorXd::Index>(nrows));
##  502 :             (void) coli_hat;  // dummy to suppress unused var warning
##  503 : 
##  504 :             stan::math::initialize(coli_hat, DUMMY_VAR__);
##  505 :             stan::math::fill(coli_hat,DUMMY_VAR__);
##  506 :             current_statement_begin__ = 27;
##  507 :             validate_non_negative_index("cocci_hat", "nrows", nrows);
##  508 :             Eigen::Matrix<local_scalar_t__,Eigen::Dynamic,1>  cocci_hat(static_cast<Eigen::VectorXd::Index>(nrows));
##  509 :             (void) cocci_hat;  // dummy to suppress unused var warning
##  510 : 
##  511 :             stan::math::initialize(cocci_hat, DUMMY_VAR__);
##  512 :             stan::math::fill(cocci_hat,DUMMY_VAR__);
##  513 : 
##  514 : 
##  515 :             current_statement_begin__ = 28;
##  516 :             for (int i = 1; i <= nrows; ++i) {
##  517 : 
##  518 :                 current_statement_begin__ = 29;
##  519 :                 stan::model::assign(coli_hat, 
##  520 :                             stan::model::cons_list(stan::model::index_uni(i), stan::model::nil_index_list()), 
##  521 :                             ((((get_base1(temp_effect_m,get_base1(Temp,i,"Temp",1),"temp_effect_m",1) + get_base1(recipe_effect_m,get_base1(Recipe,i,"Recipe",1),"recipe_effect_m",1)) + get_base1(ol_effect_m,get_base1(OL,i,"OL",1),"ol_effect_m",1)) * get_base1(Time,i,"Time",1)) + ((get_base1(recipe_effect_b,get_base1(Recipe,i,"Recipe",1),"recipe_effect_b",1) + get_base1(temp_effect_b,get_base1(Temp,i,"Temp",1),"temp_effect_b",1)) + get_base1(ol_effect_b,get_base1(OL,i,"OL",1),"ol_effect_b",1))), 
##  522 :                             "assigning variable coli_hat");
##  523 :                 current_statement_begin__ = 30;
##  524 :                 stan::model::assign(cocci_hat, 
##  525 :                             stan::model::cons_list(stan::model::index_uni(i), stan::model::nil_index_list()), 
##  526 :                             ((((get_base1(temp_effect_m,get_base1(Temp,i,"Temp",1),"temp_effect_m",1) + get_base1(recipe_effect_m,get_base1(Recipe,i,"Recipe",1),"recipe_effect_m",1)) + get_base1(ol_effect_m,get_base1(OL,i,"OL",1),"ol_effect_m",1)) * get_base1(Time,i,"Time",1)) + ((get_base1(recipe_effect_b,get_base1(Recipe,i,"Recipe",1),"recipe_effect_b",1) + get_base1(temp_effect_b,get_base1(Temp,i,"Temp",1),"temp_effect_b",1)) + get_base1(ol_effect_b,get_base1(OL,i,"OL",1),"ol_effect_b",1))), 
##  527 :                             "assigning variable cocci_hat");
##  528 :             }
##  529 : 
##  530 :             // validate transformed parameters
##  531 :             for (int i0__ = 0; i0__ < nrows; ++i0__) {
##  532 :                 if (stan::math::is_uninitialized(coli_hat(i0__))) {
##  533 :                     std::stringstream msg__;
##  534 :                     msg__ << "Undefined transformed parameter: coli_hat" << '[' << i0__ << ']';
##  535 :                     throw std::runtime_error(msg__.str());
##  536 :                 }
##  537 :             }
##  538 :             for (int i0__ = 0; i0__ < nrows; ++i0__) {
##  539 :                 if (stan::math::is_uninitialized(cocci_hat(i0__))) {
##  540 :                     std::stringstream msg__;
##  541 :                     msg__ << "Undefined transformed parameter: cocci_hat" << '[' << i0__ << ']';
##  542 :                     throw std::runtime_error(msg__.str());
##  543 :                 }
##  544 :             }
##  545 : 
##  546 :             const char* function__ = "validate transformed params";
##  547 :             (void) function__;  // dummy to suppress unused var warning
##  548 :             current_statement_begin__ = 26;
##  549 :             current_statement_begin__ = 27;
##  550 : 
##  551 :             // model body
##  552 : 
##  553 :             current_statement_begin__ = 42;
##  554 :             lp_accum__.add(cauchy_log<propto__>(sigma, 0, 1));
##  555 :             current_statement_begin__ = 43;
##  556 :             lp_accum__.add(cauchy_log<propto__>(sigma_b, 0, 1));
##  557 :             current_statement_begin__ = 44;
##  558 :             lp_accum__.add(cauchy_log<propto__>(recipe_effect_b, 0, 1));
##  559 :             current_statement_begin__ = 45;
##  560 :             lp_accum__.add(cauchy_log<propto__>(recipe_effect_m, 0, 1));
##  561 :             current_statement_begin__ = 46;
##  562 :             lp_accum__.add(cauchy_log<propto__>(ol_effect_m, 0, 1));
##  563 :             current_statement_begin__ = 47;
##  564 :             lp_accum__.add(cauchy_log<propto__>(ol_effect_b, 0, 1));
##  565 :             current_statement_begin__ = 48;
##  566 :             lp_accum__.add(cauchy_log<propto__>(temp_effect_m, 0, 1));
##  567 :             current_statement_begin__ = 49;
##  568 :             lp_accum__.add(cauchy_log<propto__>(temp_effect_b, 0, 1));
##  569 :             current_statement_begin__ = 54;
##  570 :             lp_accum__.add(normal_log<propto__>(Ecoli, coli_hat, sigma));
##  571 :             current_statement_begin__ = 55;
##  572 :             lp_accum__.add(normal_log<propto__>(Enterococci, cocci_hat, sigma_b));
##  573 : 
##  574 :         } catch (const std::exception& e) {
##  575 :             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
##  576 :             // Next line prevents compiler griping about no return
##  577 :             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
##  578 :         }
##  579 : 
##  580 :         lp_accum__.add(lp__);
##  581 :         return lp_accum__.sum();
##  582 : 
##  583 :     } // log_prob()
##  584 : 
##  585 :     template <bool propto, bool jacobian, typename T_>
##  586 :     T_ log_prob(Eigen::Matrix<T_,Eigen::Dynamic,1>& params_r,
##  587 :                std::ostream* pstream = 0) const {
##  588 :       std::vector<T_> vec_params_r;
##  589 :       vec_params_r.reserve(params_r.size());
##  590 :       for (int i = 0; i < params_r.size(); ++i)
##  591 :         vec_params_r.push_back(params_r(i));
##  592 :       std::vector<int> vec_params_i;
##  593 :       return log_prob<propto,jacobian,T_>(vec_params_r, vec_params_i, pstream);
##  594 :     }
##  595 : 
##  596 : 
##  597 :     void get_param_names(std::vector<std::string>& names__) const {
##  598 :         names__.resize(0);
##  599 :         names__.push_back("recipe_effect_m");
##  600 :         names__.push_back("temp_effect_m");
##  601 :         names__.push_back("ol_effect_m");
##  602 :         names__.push_back("recipe_effect_b");
##  603 :         names__.push_back("temp_effect_b");
##  604 :         names__.push_back("ol_effect_b");
##  605 :         names__.push_back("sigma");
##  606 :         names__.push_back("sigma_b");
##  607 :         names__.push_back("coli_hat");
##  608 :         names__.push_back("cocci_hat");
##  609 :     }
##  610 : 
##  611 : 
##  612 :     void get_dims(std::vector<std::vector<size_t> >& dimss__) const {
##  613 :         dimss__.resize(0);
##  614 :         std::vector<size_t> dims__;
##  615 :         dims__.resize(0);
##  616 :         dims__.push_back(3);
##  617 :         dimss__.push_back(dims__);
##  618 :         dims__.resize(0);
##  619 :         dims__.push_back(3);
##  620 :         dimss__.push_back(dims__);
##  621 :         dims__.resize(0);
##  622 :         dims__.push_back(3);
##  623 :         dimss__.push_back(dims__);
##  624 :         dims__.resize(0);
##  625 :         dims__.push_back(3);
##  626 :         dimss__.push_back(dims__);
##  627 :         dims__.resize(0);
##  628 :         dims__.push_back(3);
##  629 :         dimss__.push_back(dims__);
##  630 :         dims__.resize(0);
##  631 :         dims__.push_back(3);
##  632 :         dimss__.push_back(dims__);
##  633 :         dims__.resize(0);
##  634 :         dimss__.push_back(dims__);
##  635 :         dims__.resize(0);
##  636 :         dimss__.push_back(dims__);
##  637 :         dims__.resize(0);
##  638 :         dims__.push_back(nrows);
##  639 :         dimss__.push_back(dims__);
##  640 :         dims__.resize(0);
##  641 :         dims__.push_back(nrows);
##  642 :         dimss__.push_back(dims__);
##  643 :     }
##  644 : 
##  645 :     template <typename RNG>
##  646 :     void write_array(RNG& base_rng__,
##  647 :                      std::vector<double>& params_r__,
##  648 :                      std::vector<int>& params_i__,
##  649 :                      std::vector<double>& vars__,
##  650 :                      bool include_tparams__ = true,
##  651 :                      bool include_gqs__ = true,
##  652 :                      std::ostream* pstream__ = 0) const {
##  653 :         typedef double local_scalar_t__;
##  654 : 
##  655 :         vars__.resize(0);
##  656 :         stan::io::reader<local_scalar_t__> in__(params_r__,params_i__);
##  657 :         static const char* function__ = "modeld8e35e346352_model_min_namespace::write_array";
##  658 :         (void) function__;  // dummy to suppress unused var warning
##  659 :         // read-transform, write parameters
##  660 :         vector<double> recipe_effect_m;
##  661 :         size_t dim_recipe_effect_m_0__ = 3;
##  662 :         for (size_t k_0__ = 0; k_0__ < dim_recipe_effect_m_0__; ++k_0__) {
##  663 :             recipe_effect_m.push_back(in__.scalar_constrain());
##  664 :         }
##  665 :         vector<double> temp_effect_m;
##  666 :         size_t dim_temp_effect_m_0__ = 3;
##  667 :         for (size_t k_0__ = 0; k_0__ < dim_temp_effect_m_0__; ++k_0__) {
##  668 :             temp_effect_m.push_back(in__.scalar_constrain());
##  669 :         }
##  670 :         vector<double> ol_effect_m;
##  671 :         size_t dim_ol_effect_m_0__ = 3;
##  672 :         for (size_t k_0__ = 0; k_0__ < dim_ol_effect_m_0__; ++k_0__) {
##  673 :             ol_effect_m.push_back(in__.scalar_constrain());
##  674 :         }
##  675 :         vector<double> recipe_effect_b;
##  676 :         size_t dim_recipe_effect_b_0__ = 3;
##  677 :         for (size_t k_0__ = 0; k_0__ < dim_recipe_effect_b_0__; ++k_0__) {
##  678 :             recipe_effect_b.push_back(in__.scalar_constrain());
##  679 :         }
##  680 :         vector<double> temp_effect_b;
##  681 :         size_t dim_temp_effect_b_0__ = 3;
##  682 :         for (size_t k_0__ = 0; k_0__ < dim_temp_effect_b_0__; ++k_0__) {
##  683 :             temp_effect_b.push_back(in__.scalar_constrain());
##  684 :         }
##  685 :         vector<double> ol_effect_b;
##  686 :         size_t dim_ol_effect_b_0__ = 3;
##  687 :         for (size_t k_0__ = 0; k_0__ < dim_ol_effect_b_0__; ++k_0__) {
##  688 :             ol_effect_b.push_back(in__.scalar_constrain());
##  689 :         }
##  690 :         double sigma = in__.scalar_lb_constrain(0);
##  691 :         double sigma_b = in__.scalar_lb_constrain(0);
##  692 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  693 :             vars__.push_back(recipe_effect_m[k_0__]);
##  694 :             }
##  695 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  696 :             vars__.push_back(temp_effect_m[k_0__]);
##  697 :             }
##  698 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  699 :             vars__.push_back(ol_effect_m[k_0__]);
##  700 :             }
##  701 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  702 :             vars__.push_back(recipe_effect_b[k_0__]);
##  703 :             }
##  704 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  705 :             vars__.push_back(temp_effect_b[k_0__]);
##  706 :             }
##  707 :             for (int k_0__ = 0; k_0__ < 3; ++k_0__) {
##  708 :             vars__.push_back(ol_effect_b[k_0__]);
##  709 :             }
##  710 :         vars__.push_back(sigma);
##  711 :         vars__.push_back(sigma_b);
##  712 : 
##  713 :         // declare and define transformed parameters
##  714 :         double lp__ = 0.0;
##  715 :         (void) lp__;  // dummy to suppress unused var warning
##  716 :         stan::math::accumulator<double> lp_accum__;
##  717 : 
##  718 :         local_scalar_t__ DUMMY_VAR__(std::numeric_limits<double>::quiet_NaN());
##  719 :         (void) DUMMY_VAR__;  // suppress unused var warning
##  720 : 
##  721 :         try {
##  722 :             current_statement_begin__ = 26;
##  723 :             validate_non_negative_index("coli_hat", "nrows", nrows);
##  724 :             Eigen::Matrix<local_scalar_t__,Eigen::Dynamic,1>  coli_hat(static_cast<Eigen::VectorXd::Index>(nrows));
##  725 :             (void) coli_hat;  // dummy to suppress unused var warning
##  726 : 
##  727 :             stan::math::initialize(coli_hat, DUMMY_VAR__);
##  728 :             stan::math::fill(coli_hat,DUMMY_VAR__);
##  729 :             current_statement_begin__ = 27;
##  730 :             validate_non_negative_index("cocci_hat", "nrows", nrows);
##  731 :             Eigen::Matrix<local_scalar_t__,Eigen::Dynamic,1>  cocci_hat(static_cast<Eigen::VectorXd::Index>(nrows));
##  732 :             (void) cocci_hat;  // dummy to suppress unused var warning
##  733 : 
##  734 :             stan::math::initialize(cocci_hat, DUMMY_VAR__);
##  735 :             stan::math::fill(cocci_hat,DUMMY_VAR__);
##  736 : 
##  737 : 
##  738 :             current_statement_begin__ = 28;
##  739 :             for (int i = 1; i <= nrows; ++i) {
##  740 : 
##  741 :                 current_statement_begin__ = 29;
##  742 :                 stan::model::assign(coli_hat, 
##  743 :                             stan::model::cons_list(stan::model::index_uni(i), stan::model::nil_index_list()), 
##  744 :                             ((((get_base1(temp_effect_m,get_base1(Temp,i,"Temp",1),"temp_effect_m",1) + get_base1(recipe_effect_m,get_base1(Recipe,i,"Recipe",1),"recipe_effect_m",1)) + get_base1(ol_effect_m,get_base1(OL,i,"OL",1),"ol_effect_m",1)) * get_base1(Time,i,"Time",1)) + ((get_base1(recipe_effect_b,get_base1(Recipe,i,"Recipe",1),"recipe_effect_b",1) + get_base1(temp_effect_b,get_base1(Temp,i,"Temp",1),"temp_effect_b",1)) + get_base1(ol_effect_b,get_base1(OL,i,"OL",1),"ol_effect_b",1))), 
##  745 :                             "assigning variable coli_hat");
##  746 :                 current_statement_begin__ = 30;
##  747 :                 stan::model::assign(cocci_hat, 
##  748 :                             stan::model::cons_list(stan::model::index_uni(i), stan::model::nil_index_list()), 
##  749 :                             ((((get_base1(temp_effect_m,get_base1(Temp,i,"Temp",1),"temp_effect_m",1) + get_base1(recipe_effect_m,get_base1(Recipe,i,"Recipe",1),"recipe_effect_m",1)) + get_base1(ol_effect_m,get_base1(OL,i,"OL",1),"ol_effect_m",1)) * get_base1(Time,i,"Time",1)) + ((get_base1(recipe_effect_b,get_base1(Recipe,i,"Recipe",1),"recipe_effect_b",1) + get_base1(temp_effect_b,get_base1(Temp,i,"Temp",1),"temp_effect_b",1)) + get_base1(ol_effect_b,get_base1(OL,i,"OL",1),"ol_effect_b",1))), 
##  750 :                             "assigning variable cocci_hat");
##  751 :             }
##  752 : 
##  753 :             // validate transformed parameters
##  754 :             current_statement_begin__ = 26;
##  755 :             current_statement_begin__ = 27;
##  756 : 
##  757 :             // write transformed parameters
##  758 :             if (include_tparams__) {
##  759 :             for (int k_0__ = 0; k_0__ < nrows; ++k_0__) {
##  760 :             vars__.push_back(coli_hat[k_0__]);
##  761 :             }
##  762 :             for (int k_0__ = 0; k_0__ < nrows; ++k_0__) {
##  763 :             vars__.push_back(cocci_hat[k_0__]);
##  764 :             }
##  765 :             }
##  766 :             if (!include_gqs__) return;
##  767 :             // declare and define generated quantities
##  768 : 
##  769 : 
##  770 : 
##  771 :             // validate generated quantities
##  772 : 
##  773 :             // write generated quantities
##  774 :         } catch (const std::exception& e) {
##  775 :             stan::lang::rethrow_located(e, current_statement_begin__, prog_reader__());
##  776 :             // Next line prevents compiler griping about no return
##  777 :             throw std::runtime_error("*** IF YOU SEE THIS, PLEASE REPORT A BUG ***");
##  778 :         }
##  779 :     }
##  780 : 
##  781 :     template <typename RNG>
##  782 :     void write_array(RNG& base_rng,
##  783 :                      Eigen::Matrix<double,Eigen::Dynamic,1>& params_r,
##  784 :                      Eigen::Matrix<double,Eigen::Dynamic,1>& vars,
##  785 :                      bool include_tparams = true,
##  786 :                      bool include_gqs = true,
##  787 :                      std::ostream* pstream = 0) const {
##  788 :       std::vector<double> params_r_vec(params_r.size());
##  789 :       for (int i = 0; i < params_r.size(); ++i)
##  790 :         params_r_vec[i] = params_r(i);
##  791 :       std::vector<double> vars_vec;
##  792 :       std::vector<int> params_i_vec;
##  793 :       write_array(base_rng,params_r_vec,params_i_vec,vars_vec,include_tparams,include_gqs,pstream);
##  794 :       vars.resize(vars_vec.size());
##  795 :       for (int i = 0; i < vars.size(); ++i)
##  796 :         vars(i) = vars_vec[i];
##  797 :     }
##  798 : 
##  799 :     static std::string model_name() {
##  800 :         return "modeld8e35e346352_model_min";
##  801 :     }
##  802 : 
##  803 : 
##  804 :     void constrained_param_names(std::vector<std::string>& param_names__,
##  805 :                                  bool include_tparams__ = true,
##  806 :                                  bool include_gqs__ = true) const {
##  807 :         std::stringstream param_name_stream__;
##  808 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  809 :             param_name_stream__.str(std::string());
##  810 :             param_name_stream__ << "recipe_effect_m" << '.' << k_0__;
##  811 :             param_names__.push_back(param_name_stream__.str());
##  812 :         }
##  813 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  814 :             param_name_stream__.str(std::string());
##  815 :             param_name_stream__ << "temp_effect_m" << '.' << k_0__;
##  816 :             param_names__.push_back(param_name_stream__.str());
##  817 :         }
##  818 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  819 :             param_name_stream__.str(std::string());
##  820 :             param_name_stream__ << "ol_effect_m" << '.' << k_0__;
##  821 :             param_names__.push_back(param_name_stream__.str());
##  822 :         }
##  823 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  824 :             param_name_stream__.str(std::string());
##  825 :             param_name_stream__ << "recipe_effect_b" << '.' << k_0__;
##  826 :             param_names__.push_back(param_name_stream__.str());
##  827 :         }
##  828 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  829 :             param_name_stream__.str(std::string());
##  830 :             param_name_stream__ << "temp_effect_b" << '.' << k_0__;
##  831 :             param_names__.push_back(param_name_stream__.str());
##  832 :         }
##  833 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  834 :             param_name_stream__.str(std::string());
##  835 :             param_name_stream__ << "ol_effect_b" << '.' << k_0__;
##  836 :             param_names__.push_back(param_name_stream__.str());
##  837 :         }
##  838 :         param_name_stream__.str(std::string());
##  839 :         param_name_stream__ << "sigma";
##  840 :         param_names__.push_back(param_name_stream__.str());
##  841 :         param_name_stream__.str(std::string());
##  842 :         param_name_stream__ << "sigma_b";
##  843 :         param_names__.push_back(param_name_stream__.str());
##  844 : 
##  845 :         if (!include_gqs__ && !include_tparams__) return;
##  846 : 
##  847 :         if (include_tparams__) {
##  848 :             for (int k_0__ = 1; k_0__ <= nrows; ++k_0__) {
##  849 :                 param_name_stream__.str(std::string());
##  850 :                 param_name_stream__ << "coli_hat" << '.' << k_0__;
##  851 :                 param_names__.push_back(param_name_stream__.str());
##  852 :             }
##  853 :             for (int k_0__ = 1; k_0__ <= nrows; ++k_0__) {
##  854 :                 param_name_stream__.str(std::string());
##  855 :                 param_name_stream__ << "cocci_hat" << '.' << k_0__;
##  856 :                 param_names__.push_back(param_name_stream__.str());
##  857 :             }
##  858 :         }
##  859 : 
##  860 : 
##  861 :         if (!include_gqs__) return;
##  862 :     }
##  863 : 
##  864 : 
##  865 :     void unconstrained_param_names(std::vector<std::string>& param_names__,
##  866 :                                    bool include_tparams__ = true,
##  867 :                                    bool include_gqs__ = true) const {
##  868 :         std::stringstream param_name_stream__;
##  869 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  870 :             param_name_stream__.str(std::string());
##  871 :             param_name_stream__ << "recipe_effect_m" << '.' << k_0__;
##  872 :             param_names__.push_back(param_name_stream__.str());
##  873 :         }
##  874 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  875 :             param_name_stream__.str(std::string());
##  876 :             param_name_stream__ << "temp_effect_m" << '.' << k_0__;
##  877 :             param_names__.push_back(param_name_stream__.str());
##  878 :         }
##  879 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  880 :             param_name_stream__.str(std::string());
##  881 :             param_name_stream__ << "ol_effect_m" << '.' << k_0__;
##  882 :             param_names__.push_back(param_name_stream__.str());
##  883 :         }
##  884 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  885 :             param_name_stream__.str(std::string());
##  886 :             param_name_stream__ << "recipe_effect_b" << '.' << k_0__;
##  887 :             param_names__.push_back(param_name_stream__.str());
##  888 :         }
##  889 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  890 :             param_name_stream__.str(std::string());
##  891 :             param_name_stream__ << "temp_effect_b" << '.' << k_0__;
##  892 :             param_names__.push_back(param_name_stream__.str());
##  893 :         }
##  894 :         for (int k_0__ = 1; k_0__ <= 3; ++k_0__) {
##  895 :             param_name_stream__.str(std::string());
##  896 :             param_name_stream__ << "ol_effect_b" << '.' << k_0__;
##  897 :             param_names__.push_back(param_name_stream__.str());
##  898 :         }
##  899 :         param_name_stream__.str(std::string());
##  900 :         param_name_stream__ << "sigma";
##  901 :         param_names__.push_back(param_name_stream__.str());
##  902 :         param_name_stream__.str(std::string());
##  903 :         param_name_stream__ << "sigma_b";
##  904 :         param_names__.push_back(param_name_stream__.str());
##  905 : 
##  906 :         if (!include_gqs__ && !include_tparams__) return;
##  907 : 
##  908 :         if (include_tparams__) {
##  909 :             for (int k_0__ = 1; k_0__ <= nrows; ++k_0__) {
##  910 :                 param_name_stream__.str(std::string());
##  911 :                 param_name_stream__ << "coli_hat" << '.' << k_0__;
##  912 :                 param_names__.push_back(param_name_stream__.str());
##  913 :             }
##  914 :             for (int k_0__ = 1; k_0__ <= nrows; ++k_0__) {
##  915 :                 param_name_stream__.str(std::string());
##  916 :                 param_name_stream__ << "cocci_hat" << '.' << k_0__;
##  917 :                 param_names__.push_back(param_name_stream__.str());
##  918 :             }
##  919 :         }
##  920 : 
##  921 : 
##  922 :         if (!include_gqs__) return;
##  923 :     }
##  924 : 
##  925 : }; // model
##  926 : 
##  927 : }
##  928 : 
##  929 : typedef modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min stan_model;
##  930 : 
##  931 : #include <rstan/rstaninc.hpp>
##  932 : /**
##  933 :  * Define Rcpp Module to expose stan_fit's functions to R.
##  934 :  */
##  935 : RCPP_MODULE(stan_fit4modeld8e35e346352_model_min_mod){
##  936 :   Rcpp::class_<rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min,
##  937 :                boost::random::ecuyer1988> >("stan_fit4modeld8e35e346352_model_min")
##  938 :     // .constructor<Rcpp::List>()
##  939 :     .constructor<SEXP, SEXP, SEXP>()
##  940 :     // .constructor<SEXP, SEXP>()
##  941 :     .method("call_sampler",
##  942 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::call_sampler)
##  943 :     .method("param_names",
##  944 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_names)
##  945 :     .method("param_names_oi",
##  946 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_names_oi)
##  947 :     .method("param_fnames_oi",
##  948 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_fnames_oi)
##  949 :     .method("param_dims",
##  950 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_dims)
##  951 :     .method("param_dims_oi",
##  952 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_dims_oi)
##  953 :     .method("update_param_oi",
##  954 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::update_param_oi)
##  955 :     .method("param_oi_tidx",
##  956 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::param_oi_tidx)
##  957 :     .method("grad_log_prob",
##  958 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::grad_log_prob)
##  959 :     .method("log_prob",
##  960 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::log_prob)
##  961 :     .method("unconstrain_pars",
##  962 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::unconstrain_pars)
##  963 :     .method("constrain_pars",
##  964 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::constrain_pars)
##  965 :     .method("num_pars_unconstrained",
##  966 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::num_pars_unconstrained)
##  967 :     .method("unconstrained_param_names",
##  968 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::unconstrained_param_names)
##  969 :     .method("constrained_param_names",
##  970 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::constrained_param_names)
##  971 :     .method("standalone_gqs",
##  972 :             &rstan::stan_fit<modeld8e35e346352_model_min_namespace::modeld8e35e346352_model_min, boost::random::ecuyer1988>::standalone_gqs)
##  973 :   ;
##  974 : }
##  975 : 
##  976 : // declarations
##  977 : extern "C" {
##  978 : SEXP filed8e3160ded43( ) ;
##  979 : }
##  980 : 
##  981 : // definition
##  982 : 
##  983 : SEXP filed8e3160ded43(  ){
##  984 :  return Rcpp::wrap("model_min");
##  985 : }
##  986 : 
##  987 : 
## Compilation argument:
##  /Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB filed8e3160ded43.cpp 2> filed8e3160ded43.cpp.err.txt 
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:1:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Core:535:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:2:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/LU:47:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:3:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Cholesky:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Jacobi:29:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:3:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Cholesky:43:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/QR:17:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Householder:27:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:5:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/SVD:48:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Geometry:58:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:14:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/matrix_vari.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Dense:7:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Eigenvalues:58:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:96:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Sparse:26:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/SparseCore:66:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:96:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Sparse:27:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/OrderingMethods:71:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:96:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Sparse:29:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/SparseCholesky:43:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:96:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Sparse:32:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/SparseQR:35:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:96:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/csr_extract_u.hpp:6:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/Sparse:33:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/IterativeLinearSolvers:46:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
##     #pragma clang diagnostic pop
##                              ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:276:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/prob/dirichlet_rng.hpp:5:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/random/gamma_distribution.hpp:25:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/random/exponential_distribution.hpp:27:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/random/detail/int_float_pair.hpp:26:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/random/detail/integer_log2.hpp:19:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/pending/integer_log2.hpp:7:1: warning: This header is deprecated. Use <boost/integer/integer_log2.hpp> instead. [-W#pragma-messages]
## BOOST_HEADER_DEPRECATED("<boost/integer/integer_log2.hpp>");
## ^
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/header_deprecated.hpp:23:37: note: expanded from macro 'BOOST_HEADER_DEPRECATED'
## # define BOOST_HEADER_DEPRECATED(a) BOOST_PRAGMA_MESSAGE("This header is deprecated. Use " a " instead.")
##                                     ^
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/BH/include/boost/config/pragma_message.hpp:24:34: note: expanded from macro 'BOOST_PRAGMA_MESSAGE'
## # define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
##                                  ^
## <scratch space>:235:2: note: expanded from here
##  message("This header is deprecated. Use " "<boost/integer/integer_log2.hpp>" " instead.")
##  ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core.hpp:44:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13: warning: unused function 'set_zero_all_adjoints' [-Wunused-function]
## static void set_zero_all_adjoints() {
##             ^
## In file included from filed8e3160ded43.cpp:8:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/src/stan/model/model_header.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math.hpp:4:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/rev/mat.hpp:12:
## In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat.hpp:70:
## /Library/Frameworks/R.framework/Versions/3.5/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/autocorrelation.hpp:18:8: warning: function 'fft_next_good_size' is not needed and will not be emitted [-Wunneeded-internal-declaration]
## size_t fft_next_good_size(size_t N) {
##        ^
## 16 warnings generated.
## 
## CHECKING DATA AND PREPROCESSING FOR MODEL 'model_min' NOW.
## 
## COMPILING MODEL 'model_min' NOW.
## 
## STARTING SAMPLER FOR MODEL 'model_min' NOW.
## Warning: There were 4 transitions after warmup that exceeded the maximum treedepth. Increase max_treedepth above 10. See
## http://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded
## Warning: Examine the pairs() plot to diagnose sampling problems
plot_pars <- names(fit)[!grepl("hat", names(fit))]
plot(fit, pars=plot_pars, plotfun = "trace", inc_warmup = F)

mcmc_rhat(rhat(fit)[plot_pars]) + yaxis_text(hjust = 0)

#ggplot(data.frame(x = c(-5, 5)), aes(x)) +
#    stat_function(fun = dcauchy, n = 1e3, args = list(location = 0, scale = 1))
stan_dens(fit, pars=plot_pars[grepl("recipe", plot_pars)])

plot(fit, pars=plot_pars[grepl("recipe", plot_pars)])
## ci_level: 0.8 (80% intervals)
## outer_level: 0.95 (95% intervals)

stan_dens(fit, pars=plot_pars[grepl("temp", plot_pars)])

plot(fit, pars=plot_pars[grepl("temp", plot_pars)])
## ci_level: 0.8 (80% intervals)
## outer_level: 0.95 (95% intervals)

stan_dens(fit, pars=plot_pars[grepl("ol", plot_pars)])

plot(fit, pars=plot_pars[grepl("ol", plot_pars)])
## ci_level: 0.8 (80% intervals)
## outer_level: 0.95 (95% intervals)

plot(fit, pars=c("lp__"))
## ci_level: 0.8 (80% intervals)
## outer_level: 0.95 (95% intervals)

plot(fit, pars=c("sigma"))
## ci_level: 0.8 (80% intervals)
## outer_level: 0.95 (95% intervals)

#stan_model(fit)
(mle = optimizing(stan_model("./models/model_min.stan"), data=stan_data))
## $par
## recipe_effect_m[1] recipe_effect_m[2] recipe_effect_m[3] 
##        -0.06767946        -0.01880421        -0.04520354 
##   temp_effect_m[1]   temp_effect_m[2]   temp_effect_m[3] 
##         0.08677723         0.09604484        -0.35941553 
##     ol_effect_m[1]     ol_effect_m[2]     ol_effect_m[3] 
##        -0.11183693         0.03651531        -0.06629225 
## recipe_effect_b[1] recipe_effect_b[2] recipe_effect_b[3] 
##        -0.00770803         0.27782484         0.46710932 
##   temp_effect_b[1]   temp_effect_b[2]   temp_effect_b[3] 
##         5.09900031         4.63578966         3.97356504 
##     ol_effect_b[1]     ol_effect_b[2]     ol_effect_b[3] 
##         0.12205070         0.05701612         0.61687813 
##              sigma            sigma_b        coli_hat[1] 
##         1.48220513         0.77431477         5.07438189 
##        coli_hat[2]        coli_hat[3]        coli_hat[4] 
##         5.07438189         5.42500347         4.90361789 
##        coli_hat[5]        coli_hat[6]        coli_hat[7] 
##         0.85431614         5.07438189         5.13117914 
##        coli_hat[8]        coli_hat[9]       coli_hat[10] 
##         5.13117914         0.50765595         5.42500347 
##       coli_hat[11]       coli_hat[12]       coli_hat[13] 
##         5.64882607         0.50765595         5.64882607 
##       coli_hat[14]       coli_hat[15]       coli_hat[16] 
##         5.31514762         3.99888836         4.65690798 
##       coli_hat[17]       coli_hat[18]       coli_hat[19] 
##         2.85113407         5.64882607         0.50765595 
##       coli_hat[20]       coli_hat[21]       coli_hat[22] 
##         4.65690798         0.85431614         5.31514762 
##       coli_hat[23]       coli_hat[24]       coli_hat[25] 
##         5.07438189         1.62241164         5.07438189 
##       coli_hat[26]       coli_hat[27]       coli_hat[28] 
##         1.62241164         4.65690798         4.58273514 
##       coli_hat[29]       coli_hat[30]       coli_hat[31] 
##         5.07438189         5.07438189         5.07438189 
##       coli_hat[32]       coli_hat[33]       coli_hat[34] 
##         5.42500347         0.85431614         1.62241164 
##       coli_hat[35]       coli_hat[36]       coli_hat[37] 
##         4.49971767         5.07438189         2.85113407 
##       coli_hat[38]       coli_hat[39]       coli_hat[40] 
##         3.99888836         5.13117914         4.90361789 
##       coli_hat[41]       coli_hat[42]       coli_hat[43] 
##         5.64882607         5.31514762         5.31514762 
##       coli_hat[44]       coli_hat[45]       coli_hat[46] 
##         3.99888836         2.85113407         5.07438189 
##       coli_hat[47]       coli_hat[48]       coli_hat[49] 
##         0.50765595         5.42500347         1.62241164 
##       coli_hat[50]       coli_hat[51]       coli_hat[52] 
##         4.90361789         4.65690798         2.85113407 
##       coli_hat[53]       coli_hat[54]       coli_hat[55] 
##         4.90361789         4.49971767         5.07438189 
##       coli_hat[56]       coli_hat[57]       coli_hat[58] 
##         0.85431614         3.99888836         5.14830840 
##       coli_hat[59]       coli_hat[60]       coli_hat[61] 
##         4.68509775         5.70817041         4.49971767 
##       coli_hat[62]       coli_hat[63]       coli_hat[64] 
##         4.75013233         4.02287313         5.24495976 
##       coli_hat[65]       coli_hat[66]       coli_hat[67] 
##         4.49971767         4.08790771         5.13117914 
##       coli_hat[68]       coli_hat[69]       coli_hat[70] 
##         5.07438189         5.21334298         5.62902807 
##       coli_hat[71]       coli_hat[72]       coli_hat[73] 
##         5.65316630         5.74730626         5.65316630 
##       coli_hat[74]       coli_hat[75]       coli_hat[76] 
##         4.93187631         1.43310055         6.37423625 
##       coli_hat[77]       coli_hat[78]       coli_hat[79] 
##         5.74730626         5.23569238         2.20119604 
##       coli_hat[80]       coli_hat[81]       coli_hat[82] 
##         1.23306613         2.20119604         5.65316630 
##       coli_hat[83]       coli_hat[84]       coli_hat[85] 
##         4.30840600         5.23569238         5.74730626 
##       coli_hat[86]       coli_hat[87]       coli_hat[88] 
##         4.93187631         5.65316630         5.99370328 
##       coli_hat[89]       coli_hat[90]       coli_hat[91] 
##         4.93187631         1.23306613         5.65316630 
##       coli_hat[92]       coli_hat[93]       coli_hat[94] 
##         5.53049263         4.72429854         5.62902807 
##       coli_hat[95]       coli_hat[96]       coli_hat[97] 
##         2.20119604         4.93187631         3.28329271 
##       coli_hat[98]       coli_hat[99]      coli_hat[100] 
##         5.62902807         5.23569238         5.49887585 
##      coli_hat[101]      coli_hat[102]      coli_hat[103] 
##         6.37423625         1.23306613         3.28329271 
##      coli_hat[104]      coli_hat[105]      coli_hat[106] 
##         6.37423625         4.97063062         5.65316630 
##      coli_hat[107]      coli_hat[108]      coli_hat[109] 
##         6.00378788         4.72429854         6.00378788 
##      coli_hat[110]      coli_hat[111]      coli_hat[112] 
##         5.56333778         5.74730626         3.28329271 
##      coli_hat[113]      coli_hat[114]      coli_hat[115] 
##         6.37423625         5.62902807         1.43310055 
##      coli_hat[116]      coli_hat[117]      coli_hat[118] 
##         1.23306613         3.28329271         2.20119604 
##      coli_hat[119]      coli_hat[120]      coli_hat[121] 
##         6.00378788         5.43384127         4.72429854 
##      coli_hat[122]      coli_hat[123]      coli_hat[124] 
##         4.37344058         5.56333778         4.72429854 
##      coli_hat[125]      coli_hat[126]      coli_hat[127] 
##         5.65316630         1.43310055         5.03566520 
##      coli_hat[128]      coli_hat[129]      coli_hat[130] 
##         5.65316630         6.00378788         5.56333778 
##      coli_hat[131]      coli_hat[132]      coli_hat[133] 
##         5.65316630         5.65316630         5.56333778 
##      coli_hat[134]      coli_hat[135]      coli_hat[136] 
##         5.65316630         5.23569238         5.65316630 
##      coli_hat[137]      coli_hat[138]      coli_hat[139] 
##         1.43310055         4.86826801         2.23208454 
##      coli_hat[140]      coli_hat[141]      coli_hat[142] 
##         3.39337920         1.18475663         1.46398904 
##      coli_hat[143]      coli_hat[144]      coli_hat[145] 
##         5.68405479         5.68405479         5.67342426 
##      coli_hat[146]      coli_hat[147]      coli_hat[148] 
##         5.58071857         4.67598904         5.68405479 
##      coli_hat[149]      coli_hat[150]      coli_hat[151] 
##         5.68405479         1.18475663         6.32592675 
##      coli_hat[152]      coli_hat[153]      coli_hat[154] 
##         5.04196280         1.46398904         5.85739275 
##      coli_hat[155]      coli_hat[156]      coli_hat[157] 
##         3.39337920         5.68405479         4.67598904 
##      coli_hat[158]      coli_hat[159]      coli_hat[160] 
##         1.46398904         5.68405479         5.26658088 
##      coli_hat[161]      coli_hat[162]      coli_hat[163] 
##         5.04196280         6.03467638         5.58071857 
##      coli_hat[164]      coli_hat[165]      coli_hat[166] 
##         3.39337920         5.68405479         6.32592675 
##      coli_hat[167]      coli_hat[168]      coli_hat[169] 
##         6.03467638         5.85739275         4.67598904 
##      coli_hat[170]      coli_hat[171]      coli_hat[172] 
##         5.26658088         5.68405479         6.32592675 
##      coli_hat[173]      coli_hat[174]      coli_hat[175] 
##         6.03467638         5.67342426         2.23208454 
##      coli_hat[176]      coli_hat[177]      coli_hat[178] 
##         6.03467638         5.68405479         5.04196280 
##      coli_hat[179]      coli_hat[180]      coli_hat[181] 
##         1.18475663         2.23208454         5.67342426 
##      coli_hat[182]      coli_hat[183]      coli_hat[184] 
##         6.32592675         4.67598904         5.26658088 
##      coli_hat[185]      coli_hat[186]      coli_hat[187] 
##         5.85739275         1.18475663         5.22494968 
##      coli_hat[188]      coli_hat[189]      coli_hat[190] 
##         5.15991510         5.71977711         5.67342426 
##      coli_hat[191]      coli_hat[192]      coli_hat[193] 
##         2.23208454         5.58071857         1.46398904 
##      coli_hat[194]      coli_hat[195]      coli_hat[196] 
##         5.58071857         5.04196280         5.68816033 
##      coli_hat[197]      coli_hat[198]      coli_hat[199] 
##         5.62312574         6.18298776         5.85739275 
##      coli_hat[200]      coli_hat[201]      coli_hat[202] 
##         5.26658088         3.39337920         5.68405479 
##      coli_hat[203]      coli_hat[204]      coli_hat[205] 
##         5.68405479         5.68405479         4.56272506 
##      coli_hat[206]      coli_hat[207]       cocci_hat[1] 
##         4.49769048         5.05755249         5.07438189 
##       cocci_hat[2]       cocci_hat[3]       cocci_hat[4] 
##         5.07438189         5.42500347         4.90361789 
##       cocci_hat[5]       cocci_hat[6]       cocci_hat[7] 
##         0.85431614         5.07438189         5.13117914 
##       cocci_hat[8]       cocci_hat[9]      cocci_hat[10] 
##         5.13117914         0.50765595         5.42500347 
##      cocci_hat[11]      cocci_hat[12]      cocci_hat[13] 
##         5.64882607         0.50765595         5.64882607 
##      cocci_hat[14]      cocci_hat[15]      cocci_hat[16] 
##         5.31514762         3.99888836         4.65690798 
##      cocci_hat[17]      cocci_hat[18]      cocci_hat[19] 
##         2.85113407         5.64882607         0.50765595 
##      cocci_hat[20]      cocci_hat[21]      cocci_hat[22] 
##         4.65690798         0.85431614         5.31514762 
##      cocci_hat[23]      cocci_hat[24]      cocci_hat[25] 
##         5.07438189         1.62241164         5.07438189 
##      cocci_hat[26]      cocci_hat[27]      cocci_hat[28] 
##         1.62241164         4.65690798         4.58273514 
##      cocci_hat[29]      cocci_hat[30]      cocci_hat[31] 
##         5.07438189         5.07438189         5.07438189 
##      cocci_hat[32]      cocci_hat[33]      cocci_hat[34] 
##         5.42500347         0.85431614         1.62241164 
##      cocci_hat[35]      cocci_hat[36]      cocci_hat[37] 
##         4.49971767         5.07438189         2.85113407 
##      cocci_hat[38]      cocci_hat[39]      cocci_hat[40] 
##         3.99888836         5.13117914         4.90361789 
##      cocci_hat[41]      cocci_hat[42]      cocci_hat[43] 
##         5.64882607         5.31514762         5.31514762 
##      cocci_hat[44]      cocci_hat[45]      cocci_hat[46] 
##         3.99888836         2.85113407         5.07438189 
##      cocci_hat[47]      cocci_hat[48]      cocci_hat[49] 
##         0.50765595         5.42500347         1.62241164 
##      cocci_hat[50]      cocci_hat[51]      cocci_hat[52] 
##         4.90361789         4.65690798         2.85113407 
##      cocci_hat[53]      cocci_hat[54]      cocci_hat[55] 
##         4.90361789         4.49971767         5.07438189 
##      cocci_hat[56]      cocci_hat[57]      cocci_hat[58] 
##         0.85431614         3.99888836         5.14830840 
##      cocci_hat[59]      cocci_hat[60]      cocci_hat[61] 
##         4.68509775         5.70817041         4.49971767 
##      cocci_hat[62]      cocci_hat[63]      cocci_hat[64] 
##         4.75013233         4.02287313         5.24495976 
##      cocci_hat[65]      cocci_hat[66]      cocci_hat[67] 
##         4.49971767         4.08790771         5.13117914 
##      cocci_hat[68]      cocci_hat[69]      cocci_hat[70] 
##         5.07438189         5.21334298         5.62902807 
##      cocci_hat[71]      cocci_hat[72]      cocci_hat[73] 
##         5.65316630         5.74730626         5.65316630 
##      cocci_hat[74]      cocci_hat[75]      cocci_hat[76] 
##         4.93187631         1.43310055         6.37423625 
##      cocci_hat[77]      cocci_hat[78]      cocci_hat[79] 
##         5.74730626         5.23569238         2.20119604 
##      cocci_hat[80]      cocci_hat[81]      cocci_hat[82] 
##         1.23306613         2.20119604         5.65316630 
##      cocci_hat[83]      cocci_hat[84]      cocci_hat[85] 
##         4.30840600         5.23569238         5.74730626 
##      cocci_hat[86]      cocci_hat[87]      cocci_hat[88] 
##         4.93187631         5.65316630         5.99370328 
##      cocci_hat[89]      cocci_hat[90]      cocci_hat[91] 
##         4.93187631         1.23306613         5.65316630 
##      cocci_hat[92]      cocci_hat[93]      cocci_hat[94] 
##         5.53049263         4.72429854         5.62902807 
##      cocci_hat[95]      cocci_hat[96]      cocci_hat[97] 
##         2.20119604         4.93187631         3.28329271 
##      cocci_hat[98]      cocci_hat[99]     cocci_hat[100] 
##         5.62902807         5.23569238         5.49887585 
##     cocci_hat[101]     cocci_hat[102]     cocci_hat[103] 
##         6.37423625         1.23306613         3.28329271 
##     cocci_hat[104]     cocci_hat[105]     cocci_hat[106] 
##         6.37423625         4.97063062         5.65316630 
##     cocci_hat[107]     cocci_hat[108]     cocci_hat[109] 
##         6.00378788         4.72429854         6.00378788 
##     cocci_hat[110]     cocci_hat[111]     cocci_hat[112] 
##         5.56333778         5.74730626         3.28329271 
##     cocci_hat[113]     cocci_hat[114]     cocci_hat[115] 
##         6.37423625         5.62902807         1.43310055 
##     cocci_hat[116]     cocci_hat[117]     cocci_hat[118] 
##         1.23306613         3.28329271         2.20119604 
##     cocci_hat[119]     cocci_hat[120]     cocci_hat[121] 
##         6.00378788         5.43384127         4.72429854 
##     cocci_hat[122]     cocci_hat[123]     cocci_hat[124] 
##         4.37344058         5.56333778         4.72429854 
##     cocci_hat[125]     cocci_hat[126]     cocci_hat[127] 
##         5.65316630         1.43310055         5.03566520 
##     cocci_hat[128]     cocci_hat[129]     cocci_hat[130] 
##         5.65316630         6.00378788         5.56333778 
##     cocci_hat[131]     cocci_hat[132]     cocci_hat[133] 
##         5.65316630         5.65316630         5.56333778 
##     cocci_hat[134]     cocci_hat[135]     cocci_hat[136] 
##         5.65316630         5.23569238         5.65316630 
##     cocci_hat[137]     cocci_hat[138]     cocci_hat[139] 
##         1.43310055         4.86826801         2.23208454 
##     cocci_hat[140]     cocci_hat[141]     cocci_hat[142] 
##         3.39337920         1.18475663         1.46398904 
##     cocci_hat[143]     cocci_hat[144]     cocci_hat[145] 
##         5.68405479         5.68405479         5.67342426 
##     cocci_hat[146]     cocci_hat[147]     cocci_hat[148] 
##         5.58071857         4.67598904         5.68405479 
##     cocci_hat[149]     cocci_hat[150]     cocci_hat[151] 
##         5.68405479         1.18475663         6.32592675 
##     cocci_hat[152]     cocci_hat[153]     cocci_hat[154] 
##         5.04196280         1.46398904         5.85739275 
##     cocci_hat[155]     cocci_hat[156]     cocci_hat[157] 
##         3.39337920         5.68405479         4.67598904 
##     cocci_hat[158]     cocci_hat[159]     cocci_hat[160] 
##         1.46398904         5.68405479         5.26658088 
##     cocci_hat[161]     cocci_hat[162]     cocci_hat[163] 
##         5.04196280         6.03467638         5.58071857 
##     cocci_hat[164]     cocci_hat[165]     cocci_hat[166] 
##         3.39337920         5.68405479         6.32592675 
##     cocci_hat[167]     cocci_hat[168]     cocci_hat[169] 
##         6.03467638         5.85739275         4.67598904 
##     cocci_hat[170]     cocci_hat[171]     cocci_hat[172] 
##         5.26658088         5.68405479         6.32592675 
##     cocci_hat[173]     cocci_hat[174]     cocci_hat[175] 
##         6.03467638         5.67342426         2.23208454 
##     cocci_hat[176]     cocci_hat[177]     cocci_hat[178] 
##         6.03467638         5.68405479         5.04196280 
##     cocci_hat[179]     cocci_hat[180]     cocci_hat[181] 
##         1.18475663         2.23208454         5.67342426 
##     cocci_hat[182]     cocci_hat[183]     cocci_hat[184] 
##         6.32592675         4.67598904         5.26658088 
##     cocci_hat[185]     cocci_hat[186]     cocci_hat[187] 
##         5.85739275         1.18475663         5.22494968 
##     cocci_hat[188]     cocci_hat[189]     cocci_hat[190] 
##         5.15991510         5.71977711         5.67342426 
##     cocci_hat[191]     cocci_hat[192]     cocci_hat[193] 
##         2.23208454         5.58071857         1.46398904 
##     cocci_hat[194]     cocci_hat[195]     cocci_hat[196] 
##         5.58071857         5.04196280         5.68816033 
##     cocci_hat[197]     cocci_hat[198]     cocci_hat[199] 
##         5.62312574         6.18298776         5.85739275 
##     cocci_hat[200]     cocci_hat[201]     cocci_hat[202] 
##         5.26658088         3.39337920         5.68405479 
##     cocci_hat[203]     cocci_hat[204]     cocci_hat[205] 
##         5.68405479         5.68405479         4.56272506 
##     cocci_hat[206]     cocci_hat[207] 
##         4.49769048         5.05755249 
## 
## $value
## [1] -248.229
## 
## $return_code
## [1] 0